Enter the directory of the maca folder on your drive and the name of the tissue you want to analyze.
tissue_of_interest = "Diaphragm"
Load the requisite packages and some additional helper functions.
library(here)
here() starts at /Users/olgabot/code/tabula-muris
library(useful)
Loading required package: ggplot2
library(Seurat)
Loading required package: cowplot
Attaching package: 'cowplot'
The following object is masked from 'package:ggplot2':
ggsave
Loading required package: Matrix
Warning: namespace 'Biobase' is not available and has been replaced
by .GlobalEnv when processing object 'call.'
Warning: namespace 'lme4' is not available and has been replaced
by .GlobalEnv when processing object 'call.'
Warning: namespace 'MatrixModels' is not available and has been replaced
by .GlobalEnv when processing object 'call.'
Warning: namespace 'Biobase' is not available and has been replaced
by .GlobalEnv when processing object 'call.'
Warning: namespace 'lme4' is not available and has been replaced
by .GlobalEnv when processing object 'call.'
Warning: namespace 'MatrixModels' is not available and has been replaced
by .GlobalEnv when processing object 'call.'
library(dplyr)
Warning: package 'dplyr' was built under R version 3.4.2
Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
library(Matrix)
save_dir = here('00_data_ingest', 'tissue_robj')
Load the plate metadata. Check which plates have been downloaded.
plate_metadata_filename = here('00_data_ingest', 'facs_raw_data', 'metadata_FACS.csv')
plate_metadata <- read.csv(plate_metadata_filename, sep=",", header = TRUE)
colnames(plate_metadata)[1] <- "plate.barcode"
plate_metadata
“Diaphragm” is a subtissue of “Muscle” and we will have to filter for this.
tissue_plates = filter(plate_metadata, subtissue == tissue_of_interest)[,c('plate.barcode','tissue','subtissue','mouse.sex')]
tissue_plates
Load the read count data.
#Load the gene names and set the metadata columns by opening the first file
filename = here('00_data_ingest', 'facs_raw_data', 'FACS', 'Muscle-counts.csv')
raw.data = read.csv(filename, sep=",", row.names=1)
# raw.data = data.frame(row.names = rownames(raw.data))
corner(raw.data)
Get the plate barcode of each individual cell
plate.barcodes = lapply(colnames(raw.data), function(x) strsplit(strsplit(x, "_")[[1]][1], '.', fixed=TRUE)[[1]][2])
meta.data = plate_metadata[plate_metadata$plate.barcode %in% plate.barcodes, ]
dim(plate_metadata)
[1] 247 6
dim(meta.data)
[1] 10 6
corner(meta.data)
Use only cells from “Diaphragm”" plate barcodes.
subtissue.plates = filter(tissue_plates, subtissue == tissue_of_interest)
subtissue.plates = plate.barcodes %in% subtissue.plates$plate.barcode
sum(subtissue.plates)
[1] 951
raw.data = raw.data[subtissue.plates]
Create per-cell metadata from plate barcode metadata
barcode.df = t.data.frame(as.data.frame(plate.barcodes[subtissue.plates]))
head(barcode.df)
[,1]
X.D042105. "D042105"
X.D042105..1 "D042105"
X.D042105..2 "D042105"
X.D042105..3 "D042105"
X.D042105..4 "D042105"
X.D042105..5 "D042105"
D042105
D042105
D042105
D042105
D042105
D042105
rownames(barcode.df) = colnames(raw.data)
colnames(barcode.df) = c('plate.barcode')
head(barcode.df)
plate.barcode
A8.D042105.3_11_M.1.1 "D042105"
K10.D042105.3_11_M.1.1 "D042105"
L13.D042105.3_11_M.1.1 "D042105"
M15.D042105.3_11_M.1.1 "D042105"
N17.D042105.3_11_M.1.1 "D042105"
O19.D042105.3_11_M.1.1 "D042105"
D042105
D042105
D042105
D042105
D042105
D042105
rnames = row.names(barcode.df)
meta.data <- merge(barcode.df, plate_metadata, by='plate.barcode', sort = F)
row.names(meta.data) <- rnames
# Sort cells by plate barcode because that's how the data was originally
meta.data = meta.data[order(meta.data$plate.barcode), ]
raw.data = raw.data[, rownames(meta.data)]
head(raw.data)
erccs <- grep(pattern = "^ERCC-", x = rownames(x = raw.data), value = TRUE)
percent.ercc <- Matrix::colSums(raw.data[erccs, ])/Matrix::colSums(raw.data)
ercc.index <- grep(pattern = "^ERCC-", x = rownames(x = raw.data), value = FALSE)
raw.data <- raw.data[-ercc.index,]
tiss <- CreateSeuratObject(raw.data = raw.data, project = tissue_of_interest,
min.cells = 5, min.genes = 5)
tiss <- AddMetaData(object = tiss, meta.data)
tiss <- AddMetaData(object = tiss, percent.ercc, col.name = "percent.ercc")
# Change default name for sums of counts from nUMI to nReads
colnames(tiss@meta.data)[colnames(tiss@meta.data) == 'nUMI'] <- 'nReads'
Calculate percent ribosomal genes.
ribo.genes <- grep(pattern = "^Rp[sl][[:digit:]]", x = rownames(x = tiss@data), value = TRUE)
percent.ribo <- Matrix::colSums(tiss@raw.data[ribo.genes, ])/Matrix::colSums(tiss@raw.data)
tiss <- AddMetaData(object = tiss, metadata = percent.ribo, col.name = "percent.ribo")
A sanity check: reads vs genes.
GenePlot(object = tiss, gene1 = "nReads", gene2 = "nGene")
GenePlot(object = tiss, gene1 = "Pax7", gene2 = "Pax3")
GenePlot(object = tiss, gene1 = "Pax7", gene2 = "Myod1")
Filter out cells with few reads and few genes.
tiss <- FilterCells(object = tiss, subset.names = c("nGene", "nReads"),
low.thresholds = c(500, 50000), high.thresholds = c(25000, 2000000))
Normalize the data, then regress out correlation with total reads
tiss <- NormalizeData(object = tiss)
tiss <- ScaleData(object = tiss, vars.to.regress = c("nReads", "percent.ribo","Rn45s"))
[1] "Regressing out nReads" "Regressing out percent.ribo"
[3] "Regressing out Rn45s"
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 3%
|
|== | 4%
|
|=== | 4%
|
|=== | 5%
|
|==== | 6%
|
|===== | 7%
|
|===== | 8%
|
|====== | 9%
|
|====== | 10%
|
|======= | 11%
|
|======== | 12%
|
|======== | 13%
|
|========= | 13%
|
|========= | 14%
|
|========== | 15%
|
|=========== | 16%
|
|=========== | 17%
|
|=========== | 18%
|
|============ | 18%
|
|============ | 19%
|
|============= | 20%
|
|============== | 21%
|
|============== | 22%
|
|=============== | 23%
|
|================ | 24%
|
|================ | 25%
|
|================= | 26%
|
|================= | 27%
|
|================== | 27%
|
|================== | 28%
|
|=================== | 29%
|
|=================== | 30%
|
|==================== | 30%
|
|==================== | 31%
|
|===================== | 32%
|
|====================== | 33%
|
|====================== | 34%
|
|====================== | 35%
|
|======================= | 35%
|
|======================= | 36%
|
|======================== | 37%
|
|========================= | 38%
|
|========================= | 39%
|
|========================== | 39%
|
|========================== | 40%
|
|=========================== | 41%
|
|=========================== | 42%
|
|============================ | 43%
|
|============================ | 44%
|
|============================= | 44%
|
|============================= | 45%
|
|============================== | 46%
|
|=============================== | 47%
|
|=============================== | 48%
|
|================================ | 49%
|
|================================ | 50%
|
|================================= | 51%
|
|================================== | 52%
|
|================================== | 53%
|
|=================================== | 54%
|
|==================================== | 55%
|
|==================================== | 56%
|
|===================================== | 56%
|
|===================================== | 57%
|
|====================================== | 58%
|
|====================================== | 59%
|
|======================================= | 60%
|
|======================================= | 61%
|
|======================================== | 61%
|
|======================================== | 62%
|
|========================================= | 63%
|
|========================================== | 64%
|
|========================================== | 65%
|
|=========================================== | 65%
|
|=========================================== | 66%
|
|=========================================== | 67%
|
|============================================ | 68%
|
|============================================= | 69%
|
|============================================= | 70%
|
|============================================== | 70%
|
|============================================== | 71%
|
|=============================================== | 72%
|
|=============================================== | 73%
|
|================================================ | 73%
|
|================================================ | 74%
|
|================================================= | 75%
|
|================================================= | 76%
|
|================================================== | 77%
|
|=================================================== | 78%
|
|=================================================== | 79%
|
|==================================================== | 80%
|
|===================================================== | 81%
|
|===================================================== | 82%
|
|====================================================== | 82%
|
|====================================================== | 83%
|
|====================================================== | 84%
|
|======================================================= | 85%
|
|======================================================== | 86%
|
|======================================================== | 87%
|
|========================================================= | 87%
|
|========================================================= | 88%
|
|========================================================== | 89%
|
|=========================================================== | 90%
|
|=========================================================== | 91%
|
|============================================================ | 92%
|
|============================================================ | 93%
|
|============================================================= | 94%
|
|============================================================== | 95%
|
|============================================================== | 96%
|
|=============================================================== | 96%
|
|=============================================================== | 97%
|
|================================================================ | 98%
|
|================================================================ | 99%
|
|=================================================================| 99%
|
|=================================================================| 100%
[1] "Scaling data matrix"
|
| | 0%
|
|=================================================================| 100%
tiss.back <- tiss
#tiss <- tiss.back
tiss <- FindVariableGenes(object = tiss, do.plot = TRUE, x.high.cutoff = Inf, y.cutoff = 0.5)
Run Principal Component Analysis.
tiss <- RunPCA(object = tiss, pc.genes = tiss@var.genes, do.print = TRUE, pcs.print = 1:5,
genes.print = 5)
[1] "PC1"
[1] "Gsn" "Errfi1" "Des" "Chodl" "Musk"
[1] ""
[1] "Srgn" "Arhgdib" "Coro1a" "Cd74" "H2-Ab1"
[1] ""
[1] ""
[1] "PC2"
[1] "Ctsh" "AI607873" "Ctss" "Ecm1" "Lyz2"
[1] ""
[1] "Flt1" "Fabp4" "Gpihbp1" "Apold1" "Ptprb"
[1] ""
[1] ""
[1] "PC3"
[1] "C1qc" "C1qa" "C1qb" "Lyz2" "Ccl6"
[1] ""
[1] "Mfap5" "Lum" "Dcn" "Col1a2" "Ly6a"
[1] ""
[1] ""
[1] "PC4"
[1] "Cd79a" "Cd79b" "H2-DMb2" "Ms4a1" "Ly6d"
[1] ""
[1] "C1qc" "C1qa" "Ecm1" "AI607873" "C1qb"
[1] ""
[1] ""
[1] "PC5"
[1] "Cd79a" "Ms4a1" "H2-DMb2" "Ly6d" "Cd79b"
[1] ""
[1] "Il7r" "Cd3g" "Skap1" "Itk" "Emb"
[1] ""
[1] ""
tiss <- ProjectPCA(object = tiss, do.print = FALSE)
PCElbowPlot(object = tiss)
n.pcs = 10
#tiss <- tiss.back
tiss <- FindClusters(object = tiss, reduction.type = "pca", dims.use = 1:n.pcs,
resolution = 1, print.output = 0, save.SNN = TRUE, force.recalc = TRUE)
tiss <- RunTSNE(object = tiss, dims.use = 1:n.pcs, seed.use = 10, check_duplicates = F, perplexity=30)
pt.size = 0.5
# note that you can set do.label=T to help label individual clusters
TSNEPlot(object = tiss, do.label = T, pt.size = pt.size)
Check expression of genes of interest.
genes_to_check = c('Pecam1', 'Ptprc', 'Vcam1', 'Pdgfra')
#FeaturePlot(tiss, genes_to_check, pt.size = 0.5, cols.use=c("yellow", "black"), no.legend = FALSE)
FeaturePlot(tiss, genes_to_check, pt.size = pt.size, no.legend = FALSE)
# SC - subtypes
genes_to_check = c('Vcam1', 'Pax7', 'Pax3', 'Myod1', 'Myf5', 'Cd34', 'Itga7', 'Cd44', 'Calcr' #, 'Myog'
)
FeaturePlot(tiss, genes_to_check, pt.size = pt.size)
# CD45 - macrophage subtypes
genes_to_check = c('Ptprc',
'Klrb1b', 'Foxp3', # NK-cells
'Cd3d', #T-cell
'Cd19', 'Cd79a', 'Cd79b', #differentiated B cells
'Vpreb3', #naive B-cells
'Itgam', 'Fcer1g', 'C1qa' #macrophages and mast cells
#, 'Ly6g6d',
)
FeaturePlot(tiss, genes_to_check, pt.size = pt.size)
# CD31 - endothelial subtypes
genes_to_check = c('Pecam1' #, 'Vegfa', 'Cd34', 'Ptprc', 'Icam1' #, 'Dysf' #'Rapgef3', 'Vim', 'Cspg4'
)
FeaturePlot(tiss, genes_to_check, pt.size = pt.size)
# FAP - subtypes
genes_to_check = c('Atxn1', 'Pdgfra' #'Dysf', 'Vim', 'Cspg4'
)
FeaturePlot(tiss, genes_to_check, pt.size = pt.size)
How big are the clusters?
table(tiss@ident)
0 1 2 3 4 5
240 228 214 80 77 31
Color by metadata, like plate barcode, to check for batch effects.
#TSNEPlot(object = tiss, do.return = TRUE, group.by = "plate.barcode")
TSNEPlot(object = tiss, do.return = TRUE, group.by = "mouse.id", pt.size = pt.size)
#table(as.character(tiss@ident), as.character(tiss@meta.data$plate.barcode))
table(as.character(tiss@ident), as.character(tiss@meta.data$mouse.id))
3_10_M 3_11_M 3_38_F 3_39_F
0 45 70 59 66
1 49 164 1 14
2 4 7 72 131
3 21 23 15 21
4 5 40 3 29
5 4 15 7 5
Find differentially expressed markers.
tiss.markers <- FindAllMarkers(object = tiss, only.pos = TRUE, min.pct = 0.25,
thresh.use = 0.25)
Display top 24 markers per cluster.
tiss.markers %>% group_by(cluster) %>% top_n(24, avg_diff)
# To change the y-axis to show raw counts, add use.raw = T.
genes_to_check = c('Pecam1', 'Ptprc', 'Vcam1', 'Pdgfra', 'Cd19')
VlnPlot(tiss, genes_to_check #, pt.size = pt.size
)
Assigning cell type identity to clusters At a coarse level, we can use canonical markers to match the unbiased clustering to known cell types: 0: alpha 1: beta 2: beta 3: exocrine 4: duct 5: delta 6: gamma 7: endothelial 8: immune 9: stellate
# stash current cluster IDs
tiss <- StashIdent(object = tiss, save.name = "cluster.ids")
# enumerate current cluster IDs and the labels for them
cluster.ids <- c(0, 1, 2, 3, 4, 5)
annotation <- c("mesenchymal stem cell", "skeletal muscle satellite stem cell", "skeletal muscle satellite stem cell", "B cell", "endothelial cell", "macrophage")
cell_ontology_id <- c("CL:0000134", "CL:0008011", "CL:0008011", "CL:0000236", "CL:0000115", "CL:0000235")
tiss@meta.data[,'annotation'] <- plyr::mapvalues(x = tiss@ident, from = cluster.ids, to = annotation)
tiss@meta.data[,'cell_ontology_id'] <- plyr::mapvalues(x = tiss@ident, from = cluster.ids, to = cell_ontology_id)
tiss@meta.data[tiss@cell.names,'annotation'] <- as.character(tiss@meta.data$annotation)
tiss@meta.data[tiss@cell.names,'cell_ontology_id'] <- as.character(tiss@meta.data$cell_ontology_id)
TSNEPlot(object = tiss, do.label = TRUE, pt.size = 0.5, group.by='annotation')
tiss = BuildClusterTree(tiss)
[1] "Finished averaging RNA for cluster 0"
[1] "Finished averaging RNA for cluster 1"
[1] "Finished averaging RNA for cluster 2"
[1] "Finished averaging RNA for cluster 3"
[1] "Finished averaging RNA for cluster 4"
[1] "Finished averaging RNA for cluster 5"
# Get markers for a particular cluster
cluster_markers = filter(tiss.markers, cluster == 3)$gene
DotPlot(tiss, genes.plot = cluster_markers[1:12], plot.legend = T)
We can repeat the above analysis on a subset of genes, defined using cluster IDs or expression or some other metadata. This is a good way to drill down and find substructure.
# To subset data based on annotation or other metadata, you can explicitly pass cell names
anno = 'B cell'
cells.to.use = tiss@cell.names[which(tiss@meta.data$annotation == anno)]
subtiss <- SubsetData(object = tiss, cells.use = cells.to.use, do.center = F, do.scale = F)
subtiss <- NormalizeData(object = subtiss)
subtiss <- ScaleData(object = subtiss, vars.to.regress = c("nReads", "percent.ribo","Rn45s"))
[1] "Regressing out nReads" "Regressing out percent.ribo"
[3] "Regressing out Rn45s"
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 3%
|
|== | 4%
|
|=== | 4%
|
|=== | 5%
|
|==== | 6%
|
|===== | 7%
|
|===== | 8%
|
|====== | 9%
|
|====== | 10%
|
|======= | 11%
|
|======== | 12%
|
|======== | 13%
|
|========= | 13%
|
|========= | 14%
|
|========== | 15%
|
|=========== | 16%
|
|=========== | 17%
|
|=========== | 18%
|
|============ | 18%
|
|============ | 19%
|
|============= | 20%
|
|============== | 21%
|
|============== | 22%
|
|=============== | 23%
|
|================ | 24%
|
|================ | 25%
|
|================= | 26%
|
|================= | 27%
|
|================== | 27%
|
|================== | 28%
|
|=================== | 29%
|
|=================== | 30%
|
|==================== | 30%
|
|==================== | 31%
|
|===================== | 32%
|
|====================== | 33%
|
|====================== | 34%
|
|====================== | 35%
|
|======================= | 35%
|
|======================= | 36%
|
|======================== | 37%
|
|========================= | 38%
|
|========================= | 39%
|
|========================== | 39%
|
|========================== | 40%
|
|=========================== | 41%
|
|=========================== | 42%
|
|============================ | 43%
|
|============================ | 44%
|
|============================= | 44%
|
|============================= | 45%
|
|============================== | 46%
|
|=============================== | 47%
|
|=============================== | 48%
|
|================================ | 49%
|
|================================ | 50%
|
|================================= | 51%
|
|================================== | 52%
|
|================================== | 53%
|
|=================================== | 54%
|
|==================================== | 55%
|
|==================================== | 56%
|
|===================================== | 56%
|
|===================================== | 57%
|
|====================================== | 58%
|
|====================================== | 59%
|
|======================================= | 60%
|
|======================================= | 61%
|
|======================================== | 61%
|
|======================================== | 62%
|
|========================================= | 63%
|
|========================================== | 64%
|
|========================================== | 65%
|
|=========================================== | 65%
|
|=========================================== | 66%
|
|=========================================== | 67%
|
|============================================ | 68%
|
|============================================= | 69%
|
|============================================= | 70%
|
|============================================== | 70%
|
|============================================== | 71%
|
|=============================================== | 72%
|
|=============================================== | 73%
|
|================================================ | 73%
|
|================================================ | 74%
|
|================================================= | 75%
|
|================================================= | 76%
|
|================================================== | 77%
|
|=================================================== | 78%
|
|=================================================== | 79%
|
|==================================================== | 80%
|
|===================================================== | 81%
|
|===================================================== | 82%
|
|====================================================== | 82%
|
|====================================================== | 83%
|
|====================================================== | 84%
|
|======================================================= | 85%
|
|======================================================== | 86%
|
|======================================================== | 87%
|
|========================================================= | 87%
|
|========================================================= | 88%
|
|========================================================== | 89%
|
|=========================================================== | 90%
|
|=========================================================== | 91%
|
|============================================================ | 92%
|
|============================================================ | 93%
|
|============================================================= | 94%
|
|============================================================== | 95%
|
|============================================================== | 96%
|
|=============================================================== | 96%
|
|=============================================================== | 97%
|
|================================================================ | 98%
|
|================================================================ | 99%
|
|=================================================================| 99%
|
|=================================================================| 100%
[1] "Scaling data matrix"
|
| | 0%
|
|=================================================================| 100%
#subtiss@scale.data = subtiss@data
#subtiss <- ScaleData(object = subtiss)
subtiss <- FindVariableGenes(object = subtiss, do.plot = TRUE, x.high.cutoff = Inf, y.cutoff = 0.5)
subtiss <- RunPCA(object = subtiss, pcs.compute = 20)
[1] "PC1"
[1] "H2-Aa" "H2-Ab1" "Cd74" "Cd79a"
[5] "H2-Eb1" "H2-DMb2" "Ly6d" "Cd79b"
[9] "H2-DMa" "Napsa" "Faim3" "Cd83"
[13] "2010001M09Rik" "Unc93b1" "Plac8" "Ly6a"
[17] "Mef2c" "Ctsz" "H2-Oa" "Syngr2"
[21] "Cd19" "Ifi30" "Plaur" "Scd1"
[25] "Arhgdib" "Capg" "Fth1" "Tmsb4x"
[29] "Ucp2" "Cd81"
[1] ""
[1] "Il7r" "Il2rb" "Cd3g" "Cd247" "Ppp1r14c" "Cxcr6"
[7] "Smox" "Adam12" "Emb" "Atp2b4" "Icos" "Il1r1"
[13] "Cd3e" "Lxn" "Zap70" "Dgat1" "Itk" "Cd163l1"
[19] "Tmem66" "Kcnk1" "Ramp1" "Rora" "Gcnt2" "Lancl2"
[25] "Tmem64" "Itgb4" "Ppp3r1" "Spry2" "Igf1r" "Tnfrsf9"
[1] ""
[1] ""
[1] "PC2"
[1] "Junb" "Ppp1r14c" "Il1r1" "Adam12"
[5] "9430091E24Rik" "Lxn" "Sdc1" "Tpra1"
[9] "Itgb4" "Bag3" "Apaf1" "Gpnmb"
[13] "Des" "Tacstd2" "Gng4" "Zw10"
[17] "Atp2b4" "Pfkfb2" "Igf1r" "Zmpste24"
[21] "2310001A20Rik" "Kcnk1" "Ppfibp1" "Lancl2"
[25] "Slc35e2" "Zfp692" "Tmem176b" "Kbtbd4"
[29] "Zfp64" "Gcnt2"
[1] ""
[1] "Tpx2" "Ube2c" "Ddah2" "Rrm2" "Kif11" "Gpr3" "Fam83d"
[8] "Hmmr" "Cenpf" "Dntt" "Kifc1" "Top2a" "Cenpe" "Dos"
[15] "Tacc3" "Ccnb2" "Cdk1" "Fbxo5" "Ly6k" "Ccdc92" "Cdc20"
[22] "Mepce" "Mogs" "Cd8a" "Rnf26" "Rnf123" "Socs4" "Srsf1"
[29] "Cdca3" "Nmt2"
[1] ""
[1] ""
[1] "PC3"
[1] "Apaf1" "Des" "Gng4" "Zw10"
[5] "Gpnmb" "Tacstd2" "Sdc1" "2310001A20Rik"
[9] "Itgb4" "Tpra1" "9430091E24Rik" "Akap12"
[13] "Ccng2" "Kbtbd4" "Pfkfb2" "Ppfibp1"
[17] "Dnajc12" "Lyrm5" "Bag3" "Rab3gap2"
[21] "Dtwd2" "Ppp3r1" "Pdpk1" "Mesdc2"
[25] "Hdc" "Slc35e2" "Muc1" "2610204G22Rik"
[29] "Sorbs1" "Acp6"
[1] ""
[1] "Il2ra" "Dennd4c" "Srxn1" "Tnfsf11"
[5] "Ltb4r1" "Enpp5" "Bace2" "Inpp1"
[9] "Spata5" "D030028A08Rik" "Plxdc2" "Fbxl8"
[13] "Socs2" "Ramp3" "Tnfrsf1a" "Zdhhc9"
[17] "Rgs1" "Lrwd1" "Acadvl" "Flot2"
[21] "Rnf166" "Dpp7" "Nedd4" "Dusp5"
[25] "Dhcr24" "Rcbtb2" "Rasgrp1" "Scap"
[29] "Zfp689" "9930104L06Rik"
[1] ""
[1] ""
[1] "PC4"
[1] "Fbxw5" "Hsdl1" "Tasp1" "D230025D16Rik"
[5] "Hipk2" "BC025920" "Cyp39a1" "Aldh1b1"
[9] "Adam22" "Ccdc93" "Prkch" "2610019F03Rik"
[13] "Btg1" "Ly6c2" "Gbp9" "Pira2"
[17] "Nkg7" "Ccr7" "Nfrkb" "Sesn3"
[21] "Ncoa5" "Cd27" "G6pdx" "Smcr7l"
[25] "Rassf5" "AI837181" "Dirc2" "Ets1"
[29] "Osbpl2" "Tigit"
[1] ""
[1] "S100a6" "Tagln2" "Capg" "Lmna" "Dnase1l3"
[6] "Actg1" "Pnpo" "Ccnd2" "Tppp3" "Ckb"
[11] "Hmga2-ps1" "Ifi30" "Ccdc109a" "Plac8" "Trak2"
[16] "Sgta" "S100a4" "Lsp1" "Ltb4r1" "Hk2"
[21] "Tubb6" "Myg1" "Crip1" "Nsdhl" "Cd9"
[26] "Cyb5r3" "Fgl2" "Il2ra" "Igf1r" "Fam86"
[1] ""
[1] ""
[1] "PC5"
[1] "Ccdc97" "Krr1" "Sub1" "Spop" "Snrnp200" "Xylt1"
[7] "Pofut2" "Dos" "Pira2" "Snip1" "Zc3hav1" "Ano6"
[13] "Clcn4-2" "Taf4b" "Clasp1" "Cmtm8" "Snx27" "Dalrd3"
[19] "Zfp167" "Mepce" "Ttc3" "Rassf5" "Slc37a2" "Vcpip1"
[25] "Slc38a10" "Ubr3" "Mcoln2" "Apoo" "Ncoa5" "AI837181"
[1] ""
[1] "Cdc6" "Tox" "Asf1b" "Aurkb"
[5] "Dpp8" "Tmem48" "Hdac8" "Atpaf2"
[9] "Txnrd1" "Zdhhc16" "Nup88" "Casp8"
[13] "Cenpm" "Socs5" "Pxmp3" "Parvg"
[17] "Strada" "Rnf146" "Prpf3" "2810417H13Rik"
[21] "Hdac10" "Mtap" "Dpcd" "Cox10"
[25] "Creg1" "Eed" "Brf1" "Pold1"
[29] "Gins2" "Rnf41"
[1] ""
[1] ""
print("de2")
[1] "de2"
subtiss <- ProjectPCA(object = subtiss, do.print = FALSE)
PCElbowPlot(object = subtiss)
PCHeatmap(object = subtiss, pc.use = 1:9, cells.use = 80, do.balanced = TRUE, label.columns = FALSE, num.genes = 18)
subtiss <- FindClusters(object = subtiss, reduction.type = "pca", dims.use = 1:5,
resolution = 0.5, print.output = 0, save.SNN = TRUE, force.recalc = TRUE)
subtiss <- RunTSNE(object = subtiss, dims.use = 1:10, seed.use = 10, check_duplicates = F, perplexity=25)
# note that you can set do.label=T to help label individual clusters
TSNEPlot(object = subtiss, do.label = T)
Check expression of genes of interset.
genes_to_check = c('Pax7', 'Pax3', 'Myod1', 'Myf5')
FeaturePlot(subtiss, genes_to_check, pt.size = 1)
Warning in (function (data.use, feature, data.plot, pt.size, pch.use,
cols.use, : All cells have the same value of Pax7.
Warning in (function (data.use, feature, data.plot, pt.size, pch.use,
cols.use, : All cells have the same value of Pax3.
Warning in (function (data.use, feature, data.plot, pt.size, pch.use,
cols.use, : All cells have the same value of Myf5.
GenePlot(subtiss, 'Pax7', 'Pax3', use.raw = T)
Warning in cor(x = data.plot$x, y = data.plot$y): the standard deviation is
zero
When you save the annotated tissue, please give it a name.
filename = here('00_data_ingest', 'tissue_seurat_robj',
paste0(tissue_of_interest, "_seurat_tiss.Robj"))
print(filename)
[1] "/Users/olgabot/code/tabula-muris/00_data_ingest/tissue_seurat_robj/Diaphragm_seurat_tiss.Robj"
save(tiss, file=filename)
So that Biohub can easily combine all your annotations, please export them as a simple csv.
head(tiss@meta.data)
filename = here('00_data_ingest', 'tissue_annotation_csv',
paste0(tissue_of_interest, "_annotation.csv"))
write.csv(tiss@meta.data[,c('plate.barcode','annotation','cell_ontology_id')], file=filename)